/*登录和退出登录*/
let peopleCenter=document.getElementsByClassName("peopleCenter");

let personalCenterC=document.getElementsByClassName("personalCenterC");
let personalCenterO=document.getElementsByClassName("personalCenterO");
/*粉丝数*/
let FanNumber=document.getElementsByClassName("FanNumber")[0];
let FollowNumber=document.getElementsByClassName("FollowNumber")[0]
/*用户名*/
let messageName=document.getElementsByClassName("messageName")[0];
// const staticPath = /*[[@{/to/}]]*/ '';
if(sessionStorage.getItem('id')==null){
    headerPicture.remove();
    message.remove();
    let headerGoLogin=document.createElement("headerGoLogin");
    headerGoLogin.className="headerGoLogin";
    headerPictureContainer.appendChild(headerGoLogin);
    headerGoLogin.innerHTML="登录/注册";
    headerPictureContainer.style.width=58+"px";
    headerPictureContainer.style.marginRight=8+"px";
    headerGoLogin.onclick=function(){
        window.location.href="../to/toLogin";
    }
}else{
    let userName = sessionStorage.getItem('nickname');
    messageName.innerHTML=userName;
    headerPicture.style.backgroundImage='url(/final_kele_war_exploded'+sessionStorage.getItem("src")+')';
    peopleCenter[3].innerHTML="退出登录";
    peopleCenter[3].onclick=function(){
        sessionStorage.clear();
        window.location.href="../tooIndex";
        /*粉丝数*/
        FanNumber.innerHTML="<b th:text=\'${session.User.fans}\'></b>"
        FollowNumber.innerHTML="<b th:text=\'${session.User.follow}\'></b>";
    }
}